package com.balabala.goods.api;

import com.balabala.goods.pojo.dto.LockStockDTO;
import com.balabala.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @Author 何涛
 * @Date: 2023/05/08/ 15:53
 * @description
 */
@FeignClient(value = "gym-goods-service",contextId = "stockFeign")
public interface StockFeignClient {

    /**
     * 批量锁定库存
     * @param lockStockDTOList
     * @return
     */
    @PutMapping("/app/stock/lock")
    Result<String> lock(@RequestBody List<LockStockDTO> lockStockDTOList);

    /**
     * 远程调用释放锁库存
     * @return
     */
    @PutMapping("/app/stock/unlock/{orderSn}")
    Boolean unLockStock(@PathVariable String orderSn);
}
